<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id="app">
        <text-layout>
            <p slot='header'>标题信息</p>
            <p>主要内容1</p>
            <p>主要内容2</p>
            <p slot='footer'>底部信息</p>
        </text-layout>
    </div>
    <script src="./vue.js"></script>
    <script>
        Vue.component('text-layout', {
            template: `
            <div>
                <header>
                    <slot name='header'></slot>
                </header> 
                <main>
                    <slot></slot>
                </main>   
                <footer>
                    <slot name='footer'></slot>
                </footer> 
            </div>
            `
        })
        var vm = new Vue({
            el: '#app',
            data: {

            }
        })
    </script>
</body>

</html>